package zy.gongxiang.pucharse.dataobject;

import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

/**
 * @Auther: zhangy
 * @Date: 2018/9/17 11:01
 * @Description:
 */

@Entity
@Data
@DynamicUpdate
@Table(name = "md_supplier", schema = "gxtest")
public class Supplier {
    @Id
    private int id;
    private String name;
    private String contact;
    private String phone;
    private String faxno;
    private String certificate;
    private String bank;
    private String bankno;
    private String suptype;
    private String suplevel;
    private String province;
    private String city;
    private String country;
    private String address;
    private String accountcode;
    private Date applyTime;
    private Date createTime;
    private Date updateTime;


    public Supplier() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Supplier that = (Supplier) o;
        return id == that.id &&
                Objects.equals(name, that.name) &&
                Objects.equals(contact, that.contact) &&
                Objects.equals(phone, that.phone) &&
                Objects.equals(faxno, that.faxno) &&
                Objects.equals(certificate, that.certificate) &&
                Objects.equals(bank, that.bank) &&
                Objects.equals(bankno, that.bankno) &&
                Objects.equals(suptype, that.suptype) &&
                Objects.equals(suplevel, that.suplevel) &&
                Objects.equals(province, that.province) &&
                Objects.equals(city, that.city) &&
                Objects.equals(country, that.country) &&
                Objects.equals(address, that.address) &&
                Objects.equals(accountcode, that.accountcode) &&
                Objects.equals(applyTime, that.applyTime) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, contact, phone, faxno, certificate, bank, bankno, suptype, suplevel, province, city, country, address, accountcode, applyTime, createTime, updateTime);
    }
}
